package com.niiwoo.civet.trade.service.local.newRefund.notify.mq;

import org.springframework.stereotype.Component;

import com.niiwoo.asset.cardniu.dto.request.LoanStatusDTO;
import com.niiwoo.civet.trade.dao.entity.Project;
import com.niiwoo.civet.trade.service.local.newRefund.notify.dto.RefundNotifyDTO;
import com.niiwoo.civet.trade.service.local.newRefund.notify.enums.RefundNotifyEnum;

/**
 * 卡牛标的状态变更通知
 * 
 * 触发条件：标的逾期、标的结清、标的逾期到正常还款
 * 
 * @author: kevin.jia
 * @version 1.0.0
 */
@Component
public class CardNiuProjectStatusChangeNotify extends MQRefundNotify {

	@Override
	public Object bulidParam(RefundNotifyDTO refundNotifyDTO) {
		Project project = refundNotifyDTO.getProject();

		LoanStatusDTO loanStatusDTO = new LoanStatusDTO();
        loanStatusDTO.setProjectId(project.getProjectId());
        loanStatusDTO.setStatus(project.getStatus());
        loanStatusDTO.setSubStatus(project.getSubStatus());
        loanStatusDTO.setType(project.getType());
        
        return loanStatusDTO;
	}
	
	@Override
	public RefundNotifyEnum getType() {
		return RefundNotifyEnum.CARDNIU_PROJECT_STATUS_CHANGE;
	}
}